#006-选考难度B-数据解压缩-201604-17学考选考 ，shell版
alst = list(map(int,input('请输入10个用“,”分开的整数:').split(',')))
blst = []
if not alst:
    print('输入有误，使用默认数据.')
    alst = [25,0,0,0,7,78]
n=len(alst)
pa = 0 
while pa < n:
    firstdata = alst[pa]
    if firstdata != 0:
        blst.append(firstdata)
        pa = pa + 1 
        #pb = pb + 1
    else:
        count = alst[pa+1]
        if count == 0:
            blst.append(0)
            pa = pa + 2
            #pb = pb + 1
        else:
            for i  in range(count):
                blst.append(alst[pa+2])
            pa = pa + 3
            #pb = pb + count
print(','.join([str(x) for x in blst]))